package main

import "fmt"

// 定义结构体
type Student5 struct {
	id      int
	name    string
	age     int
	gender  string //字符类型
	address string
}

func main() {
	// 声明结构体切片
	var arr []Student5

	// 追加数据
	arr = append(arr, Student5{1, "zhangsan", 22, "male", "beijing"})
	arr = append(arr, Student5{2, "lisi", 22, "male", "beijing"})
	arr = append(arr, Student5{3, "wangwu", 22, "male", "beijing"})

	// 打印
	fmt.Println(arr)

	// 遍历
	fmt.Println("-----------------------")
	for _, student := range arr {
		fmt.Println(student)
	}
}
